<!-- HTML header for doxygen 1.8.6-->
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.13"/>
<title>OpenCV: cv::TermCriteria Class Reference</title>
<link href="../../opencv.ico" rel="shortcut icon" type="image/x-icon" />
<link href="../../tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="../../jquery.js"></script>
<script type="text/javascript" src="../../dynsections.js"></script>
<script type="text/javascript" src="../../tutorial-utils.js"></script>
<link href="../../search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="../../search/searchdata.js"></script>
<script type="text/javascript" src="../../search/search.js"></script>
<script type="text/x-mathjax-config">
  MathJax.Hub.Config({
    extensions: ["tex2jax.js", "TeX/AMSmath.js", "TeX/AMSsymbols.js"],
    jax: ["input/TeX","output/HTML-CSS"],
});
//<![CDATA[
MathJax.Hub.Config(
{
  TeX: {
      Macros: {
          matTT: [ "\\[ \\left|\\begin{array}{ccc} #1 & #2 & #3\\\\ #4 & #5 & #6\\\\ #7 & #8 & #9 \\end{array}\\right| \\]", 9],
          fork: ["\\left\\{ \\begin{array}{l l} #1 & \\mbox{#2}\\\\ #3 & \\mbox{#4}\\\\ \\end{array} \\right.", 4],
          forkthree: ["\\left\\{ \\begin{array}{l l} #1 & \\mbox{#2}\\\\ #3 & \\mbox{#4}\\\\ #5 & \\mbox{#6}\\\\ \\end{array} \\right.", 6],
          forkfour: ["\\left\\{ \\begin{array}{l l} #1 & \\mbox{#2}\\\\ #3 & \\mbox{#4}\\\\ #5 & \\mbox{#6}\\\\ #7 & \\mbox{#8}\\\\ \\end{array} \\right.", 8],
          vecthree: ["\\begin{bmatrix} #1\\\\ #2\\\\ #3 \\end{bmatrix}", 3],
          vecthreethree: ["\\begin{bmatrix} #1 & #2 & #3\\\\ #4 & #5 & #6\\\\ #7 & #8 & #9 \\end{bmatrix}", 9],
          cameramatrix: ["#1 = \\begin{bmatrix} f_x & 0 & c_x\\\\ 0 & f_y & c_y\\\\ 0 & 0 & 1 \\end{bmatrix}", 1],
          distcoeffs: ["(k_1, k_2, p_1, p_2[, k_3[, k_4, k_5, k_6 [, s_1, s_2, s_3, s_4[, \\tau_x, \\tau_y]]]]) \\text{ of 4, 5, 8, 12 or 14 elements}"],
          distcoeffsfisheye: ["(k_1, k_2, k_3, k_4)"],
          hdotsfor: ["\\dots", 1],
          mathbbm: ["\\mathbb{#1}", 1],
          bordermatrix: ["\\matrix{#1}", 1]
      }
  }
}
);
//]]>
</script><script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.0/MathJax.js"></script>
<link href="../../doxygen.css" rel="stylesheet" type="text/css" />
<link href="../../stylesheet.css" rel="stylesheet" type="text/css"/>
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<!--#include virtual="/google-search.html"-->
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td id="projectlogo"><img alt="Logo" src="../../opencv-logo-small.png"/></td>
  <td style="padding-left: 0.5em;">
   <div id="projectname">OpenCV
   &#160;<span id="projectnumber">4.5.2</span>
   </div>
   <div id="projectbrief">Open Source Computer Vision</div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.13 -->
<script type="text/javascript">
var searchBox = new SearchBox("searchBox", "../../search",false,'Search');
</script>
<script type="text/javascript" src="../../menudata.js"></script>
<script type="text/javascript" src="../../menu.js"></script>
<script type="text/javascript">
$(function() {
  initMenu('../../',true,false,'search.php','Search');
  $(document).ready(function() { init_search(); });
});
</script>
<div id="main-nav"></div>
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>

<div id="nav-path" class="navpath">
  <ul>
<li class="navelem"><a class="el" href="../../d2/d75/namespacecv.html">cv</a></li><li class="navelem"><a class="el" href="../../d9/d5d/classcv_1_1TermCriteria.html">TermCriteria</a></li>  </ul>
</div>
</div><!-- top -->
<div class="header">
  <div class="summary">
<a href="#pub-types">Public Types</a> &#124;
<a href="#pub-methods">Public Member Functions</a> &#124;
<a href="#pub-attribs">Public Attributes</a> &#124;
<a href="../../d4/de2/classcv_1_1TermCriteria-members.html">List of all members</a>  </div>
  <div class="headertitle">
<div class="title">cv::TermCriteria Class Reference<div class="ingroups"><a class="el" href="../../d0/de1/group__core.html">Core functionality</a> &raquo; <a class="el" href="../../dc/d84/group__core__basic.html">Basic structures</a></div></div>  </div>
</div><!--header-->
<div class="contents">

<p>The class defining termination criteria for iterative algorithms.  
 <a href="../../d9/d5d/classcv_1_1TermCriteria.html#details">More...</a></p>

<p><code>#include &lt;opencv2/core/types.hpp&gt;</code></p>
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pub-types"></a>
Public Types</h2></td></tr>
<tr class="memitem:a56fecdc291ccaba8aad27d67ccf72c57"><td class="memItemLeft" align="right" valign="top">enum &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="../../d9/d5d/classcv_1_1TermCriteria.html#a56fecdc291ccaba8aad27d67ccf72c57">Type</a> { <br />
&#160;&#160;<a class="el" href="../../d9/d5d/classcv_1_1TermCriteria.html#a56fecdc291ccaba8aad27d67ccf72c57aeb9da694ea67b3ef7d524521b580867d">COUNT</a> =1, 
<br />
&#160;&#160;<a class="el" href="../../d9/d5d/classcv_1_1TermCriteria.html#a56fecdc291ccaba8aad27d67ccf72c57a56ca2bc5cd06345060a1c1c66a8fc06e">MAX_ITER</a> =COUNT, 
<br />
&#160;&#160;<a class="el" href="../../d9/d5d/classcv_1_1TermCriteria.html#a56fecdc291ccaba8aad27d67ccf72c57a857609e73e7028e638d2ea649f3b45d5">EPS</a> =2
<br />
 }</td></tr>
<tr class="separator:a56fecdc291ccaba8aad27d67ccf72c57"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pub-methods"></a>
Public Member Functions</h2></td></tr>
<tr class="memitem:ae3130f54d419687a87349da94df1226b"><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="../../d9/d5d/classcv_1_1TermCriteria.html#ae3130f54d419687a87349da94df1226b">TermCriteria</a> ()</td></tr>
<tr class="memdesc:ae3130f54d419687a87349da94df1226b"><td class="mdescLeft">&#160;</td><td class="mdescRight">default constructor  <a href="#ae3130f54d419687a87349da94df1226b">More...</a><br /></td></tr>
<tr class="separator:ae3130f54d419687a87349da94df1226b"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:aa6ec470a6a29edadcdd5e94e114960f6"><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="../../d9/d5d/classcv_1_1TermCriteria.html#aa6ec470a6a29edadcdd5e94e114960f6">TermCriteria</a> (int <a class="el" href="../../d9/d5d/classcv_1_1TermCriteria.html#a1ab7160b93aac1aa5ae015560d6fa5ae">type</a>, int <a class="el" href="../../d9/d5d/classcv_1_1TermCriteria.html#a35d5f474a78725a9b2a54c1c357b7a35">maxCount</a>, double <a class="el" href="../../d9/d5d/classcv_1_1TermCriteria.html#ad25836c3b6f8feea30dfdcab528e23d1">epsilon</a>)</td></tr>
<tr class="separator:aa6ec470a6a29edadcdd5e94e114960f6"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a67e9b5fba7b3a70a03db89484aecceb7"><td class="memItemLeft" align="right" valign="top">bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="../../d9/d5d/classcv_1_1TermCriteria.html#a67e9b5fba7b3a70a03db89484aecceb7">isValid</a> () const</td></tr>
<tr class="separator:a67e9b5fba7b3a70a03db89484aecceb7"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pub-attribs"></a>
Public Attributes</h2></td></tr>
<tr class="memitem:ad25836c3b6f8feea30dfdcab528e23d1"><td class="memItemLeft" align="right" valign="top">double&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="../../d9/d5d/classcv_1_1TermCriteria.html#ad25836c3b6f8feea30dfdcab528e23d1">epsilon</a></td></tr>
<tr class="memdesc:ad25836c3b6f8feea30dfdcab528e23d1"><td class="mdescLeft">&#160;</td><td class="mdescRight">the desired accuracy  <a href="#ad25836c3b6f8feea30dfdcab528e23d1">More...</a><br /></td></tr>
<tr class="separator:ad25836c3b6f8feea30dfdcab528e23d1"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a35d5f474a78725a9b2a54c1c357b7a35"><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="../../d9/d5d/classcv_1_1TermCriteria.html#a35d5f474a78725a9b2a54c1c357b7a35">maxCount</a></td></tr>
<tr class="memdesc:a35d5f474a78725a9b2a54c1c357b7a35"><td class="mdescLeft">&#160;</td><td class="mdescRight">the maximum number of iterations/elements  <a href="#a35d5f474a78725a9b2a54c1c357b7a35">More...</a><br /></td></tr>
<tr class="separator:a35d5f474a78725a9b2a54c1c357b7a35"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a1ab7160b93aac1aa5ae015560d6fa5ae"><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="../../d9/d5d/classcv_1_1TermCriteria.html#a1ab7160b93aac1aa5ae015560d6fa5ae">type</a></td></tr>
<tr class="memdesc:a1ab7160b93aac1aa5ae015560d6fa5ae"><td class="mdescLeft">&#160;</td><td class="mdescRight">the type of termination criteria: COUNT, EPS or COUNT + EPS  <a href="#a1ab7160b93aac1aa5ae015560d6fa5ae">More...</a><br /></td></tr>
<tr class="separator:a1ab7160b93aac1aa5ae015560d6fa5ae"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
<div class="textblock"><p>The class defining termination criteria for iterative algorithms. </p>
<p>You can initialize it by default constructor and then override any parameters, or the structure may be fully initialized using the advanced variant of the constructor. </p>
<dl><dt><b>Examples: </b></dt><dd><a class="el" href="../../d6/d7f/samples_2cpp_2camshiftdemo_8cpp-example.html#_a55">samples/cpp/camshiftdemo.cpp</a>, <a class="el" href="../../dd/d93/samples_2cpp_2image_alignment_8cpp-example.html#_a40">samples/cpp/image_alignment.cpp</a>, <a class="el" href="../../d9/dde/samples_2cpp_2kmeans_8cpp-example.html#_a18">samples/cpp/kmeans.cpp</a>, <a class="el" href="../../d2/d1d/samples_2cpp_2lkdemo_8cpp-example.html#_a5">samples/cpp/lkdemo.cpp</a>, and <a class="el" href="../../d0/df8/samples_2cpp_2train_HOG_8cpp-example.html#_a49">samples/cpp/train_HOG.cpp</a>.</dd>
</dl></div><h2 class="groupheader">Member Enumeration Documentation</h2>
<a id="a56fecdc291ccaba8aad27d67ccf72c57"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a56fecdc291ccaba8aad27d67ccf72c57">&#9670;&nbsp;</a></span>Type</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">enum <a class="el" href="../../d9/d5d/classcv_1_1TermCriteria.html#a56fecdc291ccaba8aad27d67ccf72c57">cv::TermCriteria::Type</a></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>Criteria type, can be one of: COUNT, EPS or COUNT + EPS </p>
<table class="fieldtable">
<tr><th colspan="2">Enumerator</th></tr><tr><td class="fieldname"><a id="a56fecdc291ccaba8aad27d67ccf72c57aeb9da694ea67b3ef7d524521b580867d"></a>COUNT&#160;</td><td class="fielddoc"><p>the maximum number of iterations or elements to compute </p>
</td></tr>
<tr><td class="fieldname"><a id="a56fecdc291ccaba8aad27d67ccf72c57a56ca2bc5cd06345060a1c1c66a8fc06e"></a>MAX_ITER&#160;</td><td class="fielddoc"><p>ditto </p>
</td></tr>
<tr><td class="fieldname"><a id="a56fecdc291ccaba8aad27d67ccf72c57a857609e73e7028e638d2ea649f3b45d5"></a>EPS&#160;</td><td class="fielddoc"><p>the desired accuracy or change in parameters at which the iterative algorithm stops </p>
</td></tr>
</table>

</div>
</div>
<h2 class="groupheader">Constructor &amp; Destructor Documentation</h2>
<a id="ae3130f54d419687a87349da94df1226b"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ae3130f54d419687a87349da94df1226b">&#9670;&nbsp;</a></span>TermCriteria() <span class="overload">[1/2]</span></h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">cv::TermCriteria::TermCriteria </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>default constructor </p>

</div>
</div>
<a id="aa6ec470a6a29edadcdd5e94e114960f6"></a>
<h2 class="memtitle"><span class="permalink"><a href="#aa6ec470a6a29edadcdd5e94e114960f6">&#9670;&nbsp;</a></span>TermCriteria() <span class="overload">[2/2]</span></h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">cv::TermCriteria::TermCriteria </td>
          <td>(</td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>type</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>maxCount</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">double&#160;</td>
          <td class="paramname"><em>epsilon</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">type</td><td>The type of termination criteria, one of <a class="el" href="../../d9/d5d/classcv_1_1TermCriteria.html#a56fecdc291ccaba8aad27d67ccf72c57">TermCriteria::Type</a> </td></tr>
    <tr><td class="paramname">maxCount</td><td>The maximum number of iterations or elements to compute. </td></tr>
    <tr><td class="paramname">epsilon</td><td>The desired accuracy or change in parameters at which the iterative algorithm stops. </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<h2 class="groupheader">Member Function Documentation</h2>
<a id="a67e9b5fba7b3a70a03db89484aecceb7"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a67e9b5fba7b3a70a03db89484aecceb7">&#9670;&nbsp;</a></span>isValid()</h2>

<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">bool cv::TermCriteria::isValid </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td> const</td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

</div>
</div>
<h2 class="groupheader">Member Data Documentation</h2>
<a id="ad25836c3b6f8feea30dfdcab528e23d1"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ad25836c3b6f8feea30dfdcab528e23d1">&#9670;&nbsp;</a></span>epsilon</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">double cv::TermCriteria::epsilon</td>
        </tr>
      </table>
</div><div class="memdoc">

<p>the desired accuracy </p>

</div>
</div>
<a id="a35d5f474a78725a9b2a54c1c357b7a35"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a35d5f474a78725a9b2a54c1c357b7a35">&#9670;&nbsp;</a></span>maxCount</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int cv::TermCriteria::maxCount</td>
        </tr>
      </table>
</div><div class="memdoc">

<p>the maximum number of iterations/elements </p>

</div>
</div>
<a id="a1ab7160b93aac1aa5ae015560d6fa5ae"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a1ab7160b93aac1aa5ae015560d6fa5ae">&#9670;&nbsp;</a></span>type</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int cv::TermCriteria::type</td>
        </tr>
      </table>
</div><div class="memdoc">

<p>the type of termination criteria: COUNT, EPS or COUNT + EPS </p>

</div>
</div>
<hr/>The documentation for this class was generated from the following file:<ul>
<li>opencv2/core/<a class="el" href="../../db/dfc/modules_2core_2include_2opencv2_2core_2types_8hpp.html">types.hpp</a></li>
</ul>
</div><!-- contents -->
<!-- HTML footer for doxygen 1.8.6-->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
Generated on Fri Apr 2 2021 11:36:43 for OpenCV by &#160;<a href="http://www.doxygen.org/index.html">
<img class="footer" src="../../doxygen.png" alt="doxygen"/>
</a> 1.8.13
</small></address>
<script type="text/javascript">
//<![CDATA[
addTutorialsButtons();
//]]>
</script>
</body>
</html>
